package com.walkline.smzdm.dao;

import org.json.me.JSONObject;
import com.walkline.smzdm.SMZDMException;
import com.walkline.smzdm.SMZDMSDK;
import com.walkline.smzdm.inf.Experience;
import com.walkline.util.StringUtility;

public class SMZDMExperience extends SMZDMObject implements Experience
{
	private String _id = "";
	private String _img = "";
	private String _simg = "";
	private String _bimg = "";
	private int _img_width = 0;
	private int _img_height = 0;
	private String _title = "";
	private String _user = "";
	private String _content = "";
	private String _fav_count = "";
	private String _love_count = "";
	private String _comment_count = "";
	private int _date_time = 0;
	private int _data_time = 0;
	private String _detail_url = "";

	public SMZDMExperience(SMZDMSDK smzdm, JSONObject jsonObject) throws SMZDMException
	{
		super(smzdm, jsonObject);

		JSONObject experience = jsonObject;
		if (experience != null)
		{
			_id = experience.optString("id");
			_img = experience.optString("img");
			_simg = experience.optString("simg");
			_bimg = experience.optString("bimg");
			_img_width = experience.optInt("imgw");
			_img_height = experience.optInt("imgh");
			_title = experience.optString("title");
			_user = experience.optString("user");
			_content = experience.optString("content");
			if (_content != null) {_content = _content.substring(0, 78) + "...";}

			_fav_count = experience.optString("favcount");
			_love_count = experience.optString("lovecount");
			_comment_count = experience.optString("commentcount");
			_date_time = experience.optInt("datetime");
			_data_time =experience.optInt("datatime");
			_detail_url = experience.optString("detail_url");
		}
	}

	public String getId() {return _id;}

	public String getImg() {return _img;}

	public String getSImage() {return _simg;}

	public String getBImage() {return _bimg;}

	public int getImgWidth() {return _img_width;}

	public int getImageHeight() {return _img_height;}

	public String getTitle() {return _title;}

	public String getUser() {return _user;}

	public String getContent() {return _content;}

	public String getFavCount() {return _fav_count;}

	public String getLoveCount() {return _love_count;}

	public String getCommentCount() {return _comment_count;}

	public int getDateTime() {return _date_time;}

	public int getDataTime() {return _data_time;}

	public String getDetailUrl() {return _detail_url;}
}